// account.js

const account = {
    state: {
        accountInfo:{
            id:'0',
            name:'不关联账户',
        },
        icon:'存折',
        //添加账户页
        addAccountChooseListPage:{
            extraClass:'background-animation-none',
            show:false,
        },
        //添加现金表单页
        addAccountChooseFormPage:{
            extraClass:'background-animation-none',
            show:false,
        },
        //添加储蓄卡列表页
        addAccountSavingsCardList:{
            extraClass:'background-animation-none',
            show:false,
        },
        //添加储蓄卡表单页
        addAccountSavingsCardForm:{
            extraClass:'background-animation-none',
            show:false,
        },
        //添加信用卡列表页
        addAccountCreditCardList:{
            extraClass:'background-animation-none',
            show:false,
        },
        //添加信用卡表单页
        addAccountCreditCardForm:{
            extraClass:'background-animation-none',
            show:false,
        },
        //虚拟账户列表页
        addAccountVirtualCardList:{
            extraClass:'background-animation-none',
            show:false,
        },
        //虚拟账户表单页
        addAccountVirtualCardForm:{
            extraClass:'background-animation-none',
            show:false,
        },
        //投资账户列表页
        addAccountInvestmentAccountList:{
            extraClass:'background-animation-none',
            show:false,
        },
        //投资账户表单页
        addAccountInvestmentAccountForm:{
            extraClass:'background-animation-none',
            show:false,
        },
    },

    mutations: {
        SET_ACCOUNT(state, accountInfo) {
            state.accountInfo = accountInfo;
        },
        SET_ICON(state, icon) {
            state.icon = icon;
        },
        SET_ADD_ACCOUNT_CHOOSE_CHOOSE_LIST_EXTRA_CLASS(state,value){
            state.addAccountChooseListPage.extraClass=value;
        },
        SET_ADD_ACCOUNT_CHOOSE_CHOOSE_LIST_SHOW(state,value){
            state.addAccountChooseListPage.show = value
        },
        SET_ADD_ACCOUNT_CHOOSE_CHOOSE_FORM_EXTRA_CLASS(state,value){
            state.addAccountChooseFormPage.extraClass=value;
        },
        SET_ADD_ACCOUNT_CHOOSE_CHOOSE_FORM_SHOW(state,value){
            state.addAccountChooseFormPage.show = value
        },
        SET_ADD_ACCOUNT_SAVINGS_CARD_LIST_EXTRA_CLASS(state,value){
            state.addAccountSavingsCardList.extraClass=value;
        },
        SET_ADD_ACCOUNT_SAVINGS_CARD_LIST_SHOW(state,value){
            state.addAccountSavingsCardList.show = value
        },
        SET_ADD_ACCOUNT_SAVINGS_CARD_FORM_EXTRA_CLASS(state,value){
            state.addAccountSavingsCardForm.extraClass=value;
        },
        SET_ADD_ACCOUNT_SAVINGS_CARD_FORM_SHOW(state,value){
            state.addAccountSavingsCardForm.show = value
        },

        SET_ADD_ACCOUNT_CREDIT_CARD_LIST_EXTRA_CLASS(state,value){
            state.addAccountCreditCardList.extraClass=value;
        },
        SET_ADD_ACCOUNT_CREDIT_CARD_LIST_SHOW(state,value){
            state.addAccountCreditCardList.show = value
        },
        SET_ADD_ACCOUNT_CREDIT_CARD_FORM_EXTRA_CLASS(state,value){
            state.addAccountCreditCardForm.extraClass=value;
        },
        SET_ADD_ACCOUNT_CREDIT_CARD_FORM_SHOW(state,value){
            state.addAccountCreditCardForm.show = value
        },
        SET_ADD_ACCOUNT_VIRTUAL_CARD_LIST_EXTRA_CLASS(state,value){
            state.addAccountVirtualCardList.extraClass=value;
        },
        SET_ADD_ACCOUNT_VIRTUAL_CARD_LIST_SHOW(state,value){
            state.addAccountVirtualCardList.show = value
        },
        SET_ADD_ACCOUNT_VIRTUAL_CARD_FORM_EXTRA_CLASS(state,value){
            state.addAccountVirtualCardForm.extraClass=value;
        },
        SET_ADD_ACCOUNT_VIRTUAL_CARD_FORM_SHOW(state,value){
            state.addAccountVirtualCardForm.show = value
        },
        SET_ADD_ACCOUNT_INVESTMENT_ACCOUNT_LIST_EXTRA_CLASS(state,value){
            state.addAccountInvestmentAccountList.extraClass=value;
        },
        SET_ADD_ACCOUNT_INVESTMENT_ACCOUNT_LIST_SHOW(state,value){
            state.addAccountInvestmentAccountList.show = value
        },
        SET_ADD_ACCOUNT_INVESTMENT_ACCOUNT_FORM_EXTRA_CLASS(state,value){
            state.addAccountInvestmentAccountForm.extraClass=value;
        },
        SET_ADD_ACCOUNT_INVESTMENT_ACCOUNT_FORM_SHOW(state,value){
            state.addAccountInvestmentAccountForm.show = value
        },



    },

    actions: {
        // 更新账户信息
        UPDATE_ACCOUNT({commit}, accountInfo) {
            commit('SET_ACCOUNT', accountInfo);
            if(accountInfo.name === '不关联账户'){
                commit('SET_ICON', '存折');
            }else{
                commit('SET_ICON', accountInfo.name);
            }
        },
        //打开新增账户列表页
        ENTER_ADD_ACCOUNT_CHOOSE_LIST_PAGE({ commit}){
            commit('SET_ADD_ACCOUNT_CHOOSE_CHOOSE_LIST_EXTRA_CLASS','background-animation-enter')
            commit('SET_ADD_ACCOUNT_CHOOSE_CHOOSE_LIST_SHOW',true)
        },
        //关闭新增账户列表页
        LEAVE_ADD_ACCOUNT_CHOOSE_LIST_PAGE({ commit}){
            commit('SET_ADD_ACCOUNT_CHOOSE_CHOOSE_LIST_EXTRA_CLASS','background-animation-leave')
            setTimeout(()=>{
                commit('SET_ADD_ACCOUNT_CHOOSE_CHOOSE_LIST_SHOW',false)
            },300)
        },
        //打开添加账户表单页
        ENTER_ADD_ACCOUNT_CHOOSE_FORM_PAGE({ commit}){
            commit('SET_ADD_ACCOUNT_CHOOSE_CHOOSE_FORM_EXTRA_CLASS','background-animation-enter')
            commit('SET_ADD_ACCOUNT_CHOOSE_CHOOSE_FORM_SHOW',true)
        },
        //关闭新增账户列表页
        LEAVE_ADD_ACCOUNT_CHOOSE_FORM_PAGE({ commit}){
            commit('SET_ADD_ACCOUNT_CHOOSE_CHOOSE_FORM_EXTRA_CLASS','background-animation-leave')
            setTimeout(()=>{
                commit('SET_ADD_ACCOUNT_CHOOSE_CHOOSE_FORM_SHOW',false)
            },300)
        },
        //打开储蓄卡列表页
        ENTER_ADD_ACCOUNT_SAVING_CARD_LIST_PAGE({ commit}){
            commit('SET_ADD_ACCOUNT_SAVINGS_CARD_LIST_EXTRA_CLASS','background-animation-enter')
            commit('SET_ADD_ACCOUNT_SAVINGS_CARD_LIST_SHOW',true)
        },
        //关闭新增账户列表页
        LEAVE_ADD_ACCOUNT_SAVING_CARD_LIST_PAGE({ commit}){
            commit('SET_ADD_ACCOUNT_SAVINGS_CARD_LIST_EXTRA_CLASS','background-animation-leave')
            setTimeout(()=>{
                commit('SET_ADD_ACCOUNT_SAVINGS_CARD_LIST_SHOW',false)
            },300)

        },
        //打开储蓄卡表单页
        ENTER_ADD_ACCOUNT_SAVING_CARD_FORM_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_SAVINGS_CARD_FORM_EXTRA_CLASS','background-animation-enter')
            commit('SET_ADD_ACCOUNT_SAVINGS_CARD_FORM_SHOW',true)
        },
        //关闭储蓄卡表单页
        LEAVE_ADD_ACCOUNT_SAVING_CARD_FORM_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_SAVINGS_CARD_FORM_EXTRA_CLASS','background-animation-leave')
            setTimeout(()=>{
                commit('SET_ADD_ACCOUNT_SAVINGS_CARD_FORM_SHOW',false)
            },300)
        },
        //进入信用卡列表页
        ENTER_ADD_ACCOUNT_CREDIT_CARD_LIST_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_CREDIT_CARD_LIST_EXTRA_CLASS','background-animation-enter')
            commit('SET_ADD_ACCOUNT_CREDIT_CARD_LIST_SHOW',true)
        },
        //离开信用卡列表页
        LEAVE_ADD_ACCOUNT_CREDIT_CARD_LIST_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_CREDIT_CARD_LIST_EXTRA_CLASS','background-animation-leave')
            setTimeout(()=>{
                commit('SET_ADD_ACCOUNT_CREDIT_CARD_LIST_SHOW',false)
            },300)
        },
        //进入信用卡表单页
        ENTER_ADD_ACCOUNT_CREDIT_CARD_FORM_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_CREDIT_CARD_FORM_EXTRA_CLASS','background-animation-enter')
            commit('SET_ADD_ACCOUNT_CREDIT_CARD_FORM_SHOW',true)
        },
        //离开信用卡表单页
        LEAVE_ADD_ACCOUNT_CREDIT_CARD_FORM_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_CREDIT_CARD_FORM_EXTRA_CLASS','background-animation-leave')
            setTimeout(()=>{
                commit('SET_ADD_ACCOUNT_CREDIT_CARD_FORM_SHOW',false)
            },300)
        },

        //进入虚拟账户表单页
        ENTER_ADD_ACCOUNT_VIRTUAL_CARD_FORM_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_VIRTUAL_CARD_FORM_EXTRA_CLASS','background-animation-enter')
            commit('SET_ADD_ACCOUNT_VIRTUAL_CARD_FORM_SHOW',true)
        },
        //离开虚拟账户表单页
        LEAVE_ADD_ACCOUNT_VIRTUAL_CARD_FORM_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_VIRTUAL_CARD_FORM_EXTRA_CLASS','background-animation-leave')
            setTimeout(()=>{
                commit('SET_ADD_ACCOUNT_VIRTUAL_CARD_FORM_SHOW',false)
            },300)
        },
        //进入虚拟账户列表页
        ENTER_ADD_ACCOUNT_VIRTUAL_CARD_LIST_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_VIRTUAL_CARD_LIST_EXTRA_CLASS','background-animation-enter')
            commit('SET_ADD_ACCOUNT_VIRTUAL_CARD_LIST_SHOW',true)
        },
        //离开虚拟账户列表页
        LEAVE_ADD_ACCOUNT_VIRTUAL_CARD_LIST_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_VIRTUAL_CARD_LIST_EXTRA_CLASS','background-animation-leave')
            setTimeout(()=>{
                commit('SET_ADD_ACCOUNT_VIRTUAL_CARD_LIST_SHOW',false)
            },300)
        },
        //进入投资账户表单页
        ENTER_ADD_ACCOUNT_INVESTMENT_ACCOUNT_FORM_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_INVESTMENT_ACCOUNT_FORM_EXTRA_CLASS','background-animation-enter')
            commit('SET_ADD_ACCOUNT_INVESTMENT_ACCOUNT_FORM_SHOW',true)
        },
        //离开投资账户表单页
        LEAVE_ADD_ACCOUNT_INVESTMENT_ACCOUNT_FORM_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_INVESTMENT_ACCOUNT_FORM_EXTRA_CLASS','background-animation-leave')
            setTimeout(()=>{
                commit('SET_ADD_ACCOUNT_INVESTMENT_ACCOUNT_FORM_SHOW',false)
            },300)
        },
        //进入投资账户列表页
        ENTER_ADD_ACCOUNT_INVESTMENT_ACCOUNT_LIST_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_INVESTMENT_ACCOUNT_LIST_EXTRA_CLASS','background-animation-enter')
            commit('SET_ADD_ACCOUNT_INVESTMENT_ACCOUNT_LIST_SHOW',true)
        },
        //离开投资账户列表页
        LEAVE_ADD_ACCOUNT_INVESTMENT_ACCOUNT_LIST_PAGE({commit}){
            commit('SET_ADD_ACCOUNT_INVESTMENT_ACCOUNT_LIST_EXTRA_CLASS','background-animation-leave')
            setTimeout(()=>{
                commit('SET_ADD_ACCOUNT_INVESTMENT_ACCOUNT_LIST_SHOW',false)
            },300)
        },
    }
}

export default account
